package com.suixinsanren.design.observer.demo03;

public class StatisticsDisplay implements Observer, DisplayWeatherDate {

    private float temp;
    private float humidity;
    private float pressure;

    @Override
    public void update(float temp, float humidity, float pressure) {
        this.temp = temp;
        this.humidity = humidity;
        this.pressure = pressure;
        display();
    }

    @Override
    public void display() {
        System.out.println("------来自综合温度版-----");
        System.out.println("温度：" + temp + "℃");
        System.out.println("湿度：" + humidity + "℃");
        System.out.println("压力：" + pressure + "℃");
        System.out.println("------------------------");
    }
}
